package gui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import algo.Algo;

public class BoutonEcouteur implements ActionListener {

	private FenetreFourmi fenetre;
	private Algo algo;

	public BoutonEcouteur(Algo algo) {
		this.algo = algo;
	}

	public BoutonEcouteur(FenetreFourmi f) {
		this.fenetre = f;
	}

	@Override
	public void actionPerformed(ActionEvent a) {
		String nom_bouton = a.getActionCommand();
		switch (nom_bouton) {
		case "Quitter":
			fenetre.dispose();
			break;
		case "Stop":
			algo.arreter();
			break;
		case "Lancer":
			if (!algo.isRunning()) {
				// algo.start();
			}
			break;
		}
	}
}
